package com.demo.config;

import javax.annotation.Resource;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * <p>
 * redis通用工具类
 * </p>
 *
 */
@Component
public class RedisClient1  {
	@Resource(name="redisTemplate")
	private StringRedisTemplate template;
	
	//redis中塞入数据
	public void setData(String billcode,String json){
		template.opsForValue().set(billcode, json);
	}
	
	//redis中获取数据
	public String getData(String billcode){
		String strJson = template.opsForValue().get(billcode);
		return strJson;
		
	}
	//redis中删除数据
	public void delData(String billcode){
		template.delete(billcode);
	}
	
	
}
